#!/usr/bin/env python
'''
6.2) Ask the user to type a Python object. (That means numbers can 
be typed directly but strings must be enclosed in quotes.) Use 
"input" instead of "raw_input". Check the type of the user-input in 
the following manner: include the line "import types" at the 
beginning of your script. Then compare the type of the user-input to 
the objects types.IntType, types.FloatType and types.StringType. 
Print "The input was an integer", "the input was a real number", 
"the input was a string", respectively. 
'''

''' http://diveintopython3.org/porting-code-to-python-3-with-2to3.html
In Python 2, it contained constants for all primitive types like dict
and int. In Python 3, these constants have been eliminated; just use
the primitive type name instead. '''

from types import *
n = input("geef iets: ")
if (type(n) is int):
	print("The input was an integer")
# python 2 code: if (type(n) is types.FloatType):
if (type(n) is float):
	print("the input was a real number")
if (type(n) is str):
	print("the input was a string")

